# -*- coding: utf-8 -*-
import xlrd, xlwt

NDEP_INDEX  =0
NWEEK_INDEX =1
NNAME_INDEX =2
NPNAME_INDEX=3
NPTIME_INDEX=4
NTTIME_INDEX=5
NPJOB_INDEX =6

def write_line(s, line, values):
    for i in range(len(values)):
        s.write(line, i, values[i]) # 写单元格：行数、列数、内容
    return line+1

def set_sheet_format(sheet):
    sheet.col(NDEP_INDEX  ).width = 0x1000  # 设置列宽
    sheet.col(NWEEK_INDEX ).width = 0x0400
    sheet.col(NPNAME_INDEX).width = 0x2000
    sheet.col(NPTIME_INDEX).width = 0x0400
    sheet.col(NPJOB_INDEX ).width = 0x3000

    line = write_line(sheet, 0, [
        u"部门",
        u"周"  ,
        u"姓名",
        u"项目",
        u"工时",
        u"周总工时",
        u"项目内容",
    ])

    return line
